<template>
	<view class="fix-bottom-btn">
		<!-- #ifdef MP-ALIPAY -->
		<view class="btn">
			<coreshop-button v-bind="$attrs" @onClick="onClick()"></coreshop-button>
		</view>
		<!-- #endif -->
		
		<!-- #ifndef MP-ALIPAY -->
		<coreshop-button class="btn" v-bind="$attrs" @onClick="onClick()"></coreshop-button>
		<!-- #endif -->
	</view>
</template>

<script setup lang="ts">
	/** 使用$attrs给core-button传递属性 */
	const emits = defineEmits(['onClick']);
	const onClick = () => {
		emits('onClick');
	}
</script>

<style scoped lang="scss">
	.fix-bottom-btn {
		position: fixed;
		left: 0;
		bottom: 0;
		width: 100%;
		border-top: solid 1px #f2f2f2;
		background-color: #ffffff;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding-bottom: calc(env(safe-area-inset-bottom) / 2);

		.btn {
			width: calc(100% - 40rpx);
			margin: 20rpx;
		}
	}
</style>